<?php
// +-----------------------------------------------
// | Name: 星空框架  购物车验证规则
// +-----------------------------------------------
// | Version: V5.0
// +-----------------------------------------------
// | Author: xkyinzhe <zhonghuaxinxing@sina.cn>
// +-----------------------------------------------
// | Time: 2021-05-10 11:14
// +-----------------------------------------------
declare(strict_types=1);

namespace app\common\validate;

use think\Validate;

/**
 * @xk 购物车验证规则
 */
class Car extends Validate
{
  protected $rule = [
  'goods_id' => 'number|min:1',
  'buy_num' => 'number|min:1',
  'user_sn' => 'require|min:2|max:100',
  ];
  protected $message = [
    'goods_id.number' => '请选择需要加入购物车的产品',
    'buy_num.number' => '请填写需要购买的数量，最少一件',
    'user_sn.require' => '请先进行登陆'
  ];
  protected $scene = [
    'create' => ['goods_id','buy_num','user_sn']
  ];
}
